#pragma once

//#include <srs_kernel_aac.hpp>
#include <srs_core.hpp>

#if !defined(SRS_EXPORT_LIBRTMP)

#include <string>

#include <srs_kernel_codec.hpp>

class SrsStream;
class SrsFileWriter;
class SrsFileReader;

/**
* encode data to aac file.
*/
class SrsAacEncoder {
private:
    SrsFileWriter* _fs;
private:
    SrsAacObjectType aac_object;
    int8_t aac_sample_rate;
    int8_t aac_channels;
    bool got_sequence_header;
private:
    SrsStream* tag_stream;
public:
    SrsAacEncoder();
    virtual ~SrsAacEncoder();
public:
    /**
    * initialize the underlayer file stream.
    * @remark user can initialize multiple times to encode multiple aac files.
    * @remark, user must free the fs, aac encoder never close/free it.
    */
    virtual int initialize(SrsFileWriter* fs);
public:
    /**
    * write audio/video packet.
    * @remark assert data is not NULL.
    */
    virtual int write_audio(int64_t timestamp, char* data, int size);
};

#endif
